// pages/shop/main/index/index.js
import tips from '../../../../class/Utils/Tips'
import http from '../../../../service/http.js'
import shouquan from '../../../../class/login.js'


Page({
  data: {

  },
  onShow: function () {
    var user = wx.getStorageSync('user');
    var that = this;

    if (!user) {
      that.setData({
        shouquan: 1
      })
    } else {
      that.setData({
        shouquan: 0
      })

      that.setData({
        uinfo: user
      });
      //会员等级
      // http.req("/Wxapi/userlvl", { uid: user.userid }, function (res) {
      //   console.log(res)
      //   that.setData({
      //     hylvl: res
      //   })
      // });
      //收藏
      // http.req('/Wxpro/sctotal/uid/' + user.userid, {}, function (res) {
      //   that.setData({
      //     sctotal: res
      //   });
      // });

//待收货数目
      // http.req('/Wxorder/daishoutotal/uid/' + user.userid + '/type/2', {}, function (res) {
      //   that.setData({
      //     daishoutotal: res
      //   });
      // });



    }
  },
  gotolink:function(e){
    var that = this
    var thisurl = e.currentTarget.dataset.url
    console.log(e)
    tips.goto(thisurl)
  },
  gotoorder: function (e) {
    var type = e.currentTarget.dataset.type
    var url = "/pages/shop/order/list/list?type="+type
    tips.goto(url)
  },
})